/*
 * VerNucleoAction.java
 *
 * Created on 30 de enero de 2008, 07:04 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package perucuy.logic;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.beanutils.BeanUtils;
import perucuy.transfers.NucleoTO;

import org.apache.log4j.Logger;
import perucuy.services.NucleoService;
import perucuy.services.DominiosService;
import static perucuy.utils.Funciones.fechaAcadena;
/**
 *
 * @author OMATEO
 */
public class VerNucleoAction extends Action {
    private static Logger log = Logger.getLogger(VerNucleoAction.class);
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        HttpSession session = request.getSession();
        String codigo = request.getParameter("codnucleo");
        if (codigo==null) {
            if (request.getAttribute("codnucleo")!=null) {
                int icodigo = (Integer)request.getAttribute("codnucleo");
                if (icodigo>0)
                    codigo=""+icodigo;
            }
        }
        NucleoService nucleosvr = new NucleoService();
        if (codigo!=null) {
            NucleoTO to = nucleosvr.getNucleo(Integer.parseInt(codigo));
            request.setAttribute("nucleo",to);
        }
        return mapping.findForward("success");
    }
    
}
